导航菜单
首页 >  Magic Square Association  > Magic Square Calculator

Magic Square Calculator

What is a magic square?

A magic square is a square grid of integer numbers arranged in such a way that their positions respect three rules:

No numbers repeat;The summation the numbers in each row and column returns the same value; andThe sum of the values in both diagonals is equal to the values of summed rows and columns.

The magic square is not you everyday square; for that one, visit the square calculator! And if you are looking for perfect but not magic squares, we've got you: try the perfect square calculator😉

However, the magic doesn't end here. It is possible to arrange numbers in such a way to satisfy other rules - this generates different types of magic squares. We then have:

Pandiagonal magic squares - Where the sum of the numbers on a broken diagonal is the same as the sums of the rows and columns;Associative magic squares - Where cells symmetrical with respect to the center sum to the value of n2−1n^2-1n2−1, where nnn is the order of the square; andMost-perfect magic squares - This square is both pandiagonal and:Each 2 by 2 subsquare has a total sum equal to a quarter of the value of its rows divided by nnn; andCells separated by n2\tfrac{n}{2}2n​ on a diagonal sum to n2+1n^2+1n2+1.

🔎 A broken diagonal is an offset diagonal that "wraps" around the corner of a square. To visualize it, imagine putting two identical magic squares side by side: a broken diagonal would start in one and end in the next.

Why stop at squares, though? Mathematicians have sprinkled magic over circles, triangles, hexagons, and many other shapes. Triangular numbers are not magic, but still interesting: discover them at our triangular numbers calculator.

Generalizing a magic square in higher dimensions gives us the magic hypercubes, where the sums are generalized over the various faces of the solid and the spatial diagonals. But this is definitely too complicated. Back to squares one! 😉

相关推荐: